package client.entidades;

import client.colecoes.ColecaoUsuario;
import comum.IMsgSource;

/**
 *
 * @author Anderson
 */
public class Channel implements IMsgSource {

    private ColecaoUsuario users = new ColecaoUsuario();
    private String name;

    public Channel(String name) {
        this.name = name;
    }

    public ColecaoUsuario getUsers() {
        return users;
    }

    public void setUsers(ColecaoUsuario users) {
        this.users = users;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Channel other = (Channel) obj;
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }

    @Override
    public String toString() {
        return "Channel{ name= " + name + '}';
    }

    public String getStringName() {
        return this.name;
    }

    public boolean isChannel() {
        return true;
    }

    public boolean isUser() {
        return false;
    }

    public String getNome() {
        return getStringName();
    }

    public void rmUser(User u) {
        users.removerUsuario(u);
    }
}
